#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "headers.h"
#include <QMainWindow>
#include "about.h"
#include "xgstring.h"
#include "person.h"
#include "status.h"
#include "reply.h"
#include "xgdraw.h"
namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

    int index, max_index, page, max_page;
    bool got_friend_list, got_friend_status, got_friend_status_replies,
        got_target_status, got_target_status_replies;
    person target;
    xgDraw scene;
    QVector<person> Friends;
    QVector<status> Status, TargetStatus;
    QVector<reply> Replies, TargetReplies;
    QVector<QDateTime> TimeLine;
    void analyse();
    void analyse_from();


protected:
    void changeEvent(QEvent *e);

private:
    Ui::MainWindow *ui;

public slots:
    void mousePressEvent(QMouseEvent *);
    void mouseMoveEvent(QMouseEvent *);
    void on_TimeLine_clicked();
    void on_SelectbyID_clicked();
    void on_Init_clicked();
    void on_pushButton_clicked();
    void on_lineEdit_textEdited(QString );
    void on_Refresh_clicked();
    void on_OK_clicked();

    void on_webView_loadProgress(int progress);
    void on_webView_titleChanged(QString title);
    void on_webView_loadFinished(bool );
    void on_about_clicked();
    void on_exit_clicked();
    /*********/
    void on_pushButton_2_clicked();
    void start_get_status();
    void start_get_reply();

    void get_friendlist();
    void call_get_friendlist();

    void get_status();
    void call_getstatus();

    void get_reply();
    void call_reply();
    /*********/
    void on_pushButton_from_clicked();
    void start_get_target_status();
    void start_get_target_status_replies();

    void get_target_friendlist();
    void call_get_target_friendlist();

    void get_target_status();
    void call_get_target_status();

    void get_target_status_replies();
    void call_get_target_status_replies();

private slots:
    void on_MainWindow_destroyed();
    void on_dateEdit_dateChanged(QDate date);
    void on_dateEdit_2_dateChanged(QDate date);
    void on_graphicsView_destroyed();
};


#endif // MAINWINDOW_H
